package com.java.oop;

public class Student {

    //姓名属性
    private String name;
    //年龄属性
    private int age;
    //性别属性
    private String sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public String getSex() {
        return sex;
    }

    public Student(String name) {
        this.name = name;
        System.out.println("我是无参构造方法");
    }

    //构造方法
    public Student(String name, int age, String sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    //方法
    public void study(){
        System.out.println("学习");
    }
}
